package com.free.javaplus.base;

public class Constants {
	public static  CommonBean getBeanByName(String beanName) {
		Class beanClass;
		try {
			beanClass = Class.forName("com.javaplus.db." + beanName + ".ui."
					+ beanName + "Bean");
			CommonBean bean = (CommonBean) beanClass.newInstance();
			return bean;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return null;
	}
}
